package com.qiaofang.repository;

import com.qiaofang.entity.Premises;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

@Repository
public interface PremisesRepository extends JpaRepository<Premises, Long> {

    @Query(value = "from Premises p where p.companyId = :companyId and p.name in (:names) order by p.id asc ")
    List<Premises> listPremisesByName(@Param(value = "names") Set<String> premisesNameList, @Param(value = "companyId") Long companyId);

}
